package com.demo.pattern.simple;

import com.demo.pattern.entity.DellMouse;
import com.demo.pattern.entity.HpMouse;
import com.demo.pattern.entity.Mouse;
import com.demo.pattern.entity.TkMouse;

/**
 * @author linchong
 * @version 1.0
 * @Date: 2022-05-11 21:59
 * @Description: MouseFactory$
 */
public class MouseFactory {
	public static Mouse createMouse(int type){
		switch (type){
			case 0: return new DellMouse();
			case 1: return new HpMouse();
			default: return new TkMouse();
		}
	}
	public static void main(String[] args) {
		Mouse mouse = MouseFactory.createMouse(1);
		mouse.sayHi();
	}
}
